package com.java.util;

import com.java.bean.User;

import javax.servlet.http.HttpSession;

public class UserUtil {
    public static String getUserName(HttpSession session){
        return (String) session.getAttribute("adminUserName");
    }
    public static String getUserPhone(HttpSession session){
        // TODO : 还没有编写柜子端,未存储任何的录入人信息
        return "18888888888";
    }

    public static String getLoginSms(HttpSession session, String phone) {
        return session.getAttribute(phone).toString();
    }

    public static void setLoginSms(HttpSession session, String phone, String code) {
        session.setAttribute(phone, code);
    }

    public static void setWxUser(HttpSession session, User user) {
        session.setAttribute("wxUser", user);
    }

    public static User getWxUser(HttpSession session) {
        return (User) session.getAttribute("wxUser");
    }
}
